<?php
// $Id: default.php 386 2012-05-24 14:05:40Z tomqin@gmail.com $

defined('IN_ADMIN') or exit('Access Denied!');

class Default_Action extends Action_Admin{

    public function init(){
        if(!in_array(strtolower($this->action), array('menu', 'position'))){
            $this->initUser();
        }
    }

    public function onIndex(){
        $this->render('admin/default', true);
    }

    public function onMain(){
        $this->render('admin/default_main');
    }

    public function onMenu(){
        /*
        if($this->user->status == USER_BUSINESS){
            $shop_id = Db::getFirst("SELECT shop_id FROM `biz_shop` WHERE admin_uid = '{$this->user->uid}'");
            $this->setVar('shop_id', intval($shop_id));
        }
        */
        $this->setVar('shop_type', array_get_int($_GET, 'shop_type'));
        $this->setVar('shop_id', array_get_int($_GET, 'shop_id'));
        $this->render('admin/default_menu', true);
    }

    function __destruct(){
        //print_r($this->db);
        //print_r($_POST);
    }
}
?>